<template>
  <div class="hospital-container">
    <com-tab-bar :title="title"/>
  </div>
</template>

<script>
import comTabBar from '../../components/comTapBar'

export default {
  data() {
    return {
      title: '医院详情'
    }
  },
  components: {
    comTabBar
  },
  beforeRouteEnter(to, from, next) {
    console.log('params:')
    console.log(to.params)
    const hospitalId = to.params.id
    console.log('id:' + hospitalId)
    if (hospitalId) {
      if (/^\d+$/.test(hospitalId)) {
        next()
      }else {
        next({ path: '*' })
      }
    } else {
      next({ path: '*' })
    }
  }
}
</script>

<style lang="scss">

</style>
